import javax.swing.tree.TreeModel;

import com.mzm.api.CategoryDto;
import com.mzm.api.MzmAdminFacade;
import com.mzm.remoting.IMzmServices;
import com.mzm.remoting.MzmServices;
import com.mzm.service.util.CategoryDtoTreeModel;

import dnl.utils.text.tree.TextTree;


public class A {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		IMzmServices services = MzmServices.getHttpInvokerServices("localhost:8080");
		MzmAdminFacade mzmAdminFacade = services.getMzmAdminFacade();
		mzmAdminFacade.createCategory("/d");
		printRmTree(mzmAdminFacade);
	}

	public static void printRmTree(MzmAdminFacade mzmAdminFacade) {
		CategoryDto root = mzmAdminFacade.getCategoryTree();
		TreeModel treeModel = new CategoryDtoTreeModel(root);
		TextTree tt = new TextTree(treeModel);
		tt.printTree();
	}
}
